from django.db import models

# Create your models here.

"""
实验室表
"""


class Experiment(models.Model):
    name = models.CharField(max_length=32, verbose_name='名称')
    floor = models.CharField(max_length=11, verbose_name='楼层')
    room_number = models.CharField(max_length=32, verbose_name='房间号')
    principal = models.CharField(max_length=32, verbose_name='负责人')
    User = models.ManyToManyField('User')

"""
资产表
"""


class Property(models.Model):
    material_name = models.CharField(max_length=32, verbose_name='物资名称')
    material_description = models.TextField(verbose_name='物资描述')
    material_number = models.CharField(max_length=32, verbose_name='物资编号')
    buy_time = models.DateTimeField(auto_now_add=True, verbose_name='够买时间')
    purchaser = models.CharField(max_length=32, verbose_name='购买人')
    Experiment = models.ForeignKey('Experiment',on_delete=models.CASCADE)


"""
用户表
"""


class User(models.Model):
    username = models.CharField(max_length=32, verbose_name='账号')
    password = models.CharField(max_length=32, verbose_name='密码')
    full_name = models.CharField(max_length=32, verbose_name='姓名')
    phone_number = models.CharField(max_length=32, verbose_name='手机号')
